package wordroid.widget;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.preference.DialogPreference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TimePicker;
import java.util.HashMap;

public class timePreference extends DialogPreference
{
  public Context context;
  public LinearLayout ll;
  TimePicker timePicker;

  public timePreference(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    this.context = paramContext;
  }

  protected void onBindDialogView(View paramView)
  {
    super.onBindDialogView(paramView);
  }

  protected void onDialogClosed(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      HashMap localHashMap = new HashMap();
      localHashMap.put("hour", this.timePicker.getCurrentHour());
      localHashMap.put("minute", this.timePicker.getCurrentMinute());
      String str1 = " 上午";
      if (this.timePicker.getCurrentHour().intValue() > 11)
        str1 = " 下午";
      int i = ((Integer)localHashMap.get("minute")).intValue();
      String str2 = String.valueOf(i);
      if (i < 10)
        str2 = "0" + i;
      persistString(this.timePicker.getCurrentHour() + ":" + str2 + str1);
      getOnPreferenceChangeListener().onPreferenceChange(this, localHashMap);
    }
    super.onDialogClosed(paramBoolean);
  }

  protected void onPrepareDialogBuilder(AlertDialog.Builder paramBuilder)
  {
    super.onPrepareDialogBuilder(paramBuilder);
    this.ll = new LinearLayout(this.context);
    this.ll.setLayoutParams(new LinearLayout.LayoutParams(-2, -2));
    this.ll.setGravity(17);
    this.timePicker = new TimePicker(this.context);
    this.timePicker.setIs24HourView(Boolean.valueOf(true));
    this.ll.addView(this.timePicker);
    paramBuilder.setView(this.ll);
  }
}

/* Location:           E:\Desktop\Android\英语词汇记忆\classes_dex2jar.jar
 * Qualified Name:     wordroid.widget.timePreference
 * JD-Core Version:    0.5.3
 */